package com.sina.shop.service.collect;

import com.sina.shop.domain.collect.CollectBusiness;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description: 调用服务，并配置断路器，当调用出错时调用默认的配置。
 * 段浩杰   2018-01-31-17:40
 */
@FeignClient(value = "SHOP-SPRING-CLOUD-ALL", fallback = CollectBusinessServiceBack.class)
public interface CollectBusinessService {

    @RequestMapping(value = "/collectBusiness/getCollectBusinessByAdminId", method = RequestMethod.GET)
    List<CollectBusiness> getCollectBusinessByAdminId(@RequestParam("adminId") Long adminId);

    @RequestMapping(value = "/collectBusiness/getCollectBusinessByAidAndBid", method = RequestMethod.GET)
    CollectBusiness getCollectBusinessByAidAndBid(@RequestParam("adminId") Long adminId, @RequestParam("businessId") Long businessId);

    @RequestMapping(value = "/collectBusiness/saveCollectBusiness", method = RequestMethod.POST)
    CollectBusiness saveCollectBusiness(@RequestBody(required = false) CollectBusiness collectBusiness);

    @RequestMapping(value = "/collectBusiness/deleteCollectBusiness", method = RequestMethod.POST)
    Integer deleteCollectBusiness(@RequestParam("id") Long id);

}
